/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gov.mtc.dgac.licencias.persistence;

import java.util.List;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import pe.gov.mtc.dgac.licencias.bean.SeccionTO;

/**
 *
 * @author elvis
 */
@Repository
public class SeccionHibDAO extends HibernateDaoSupport implements SeccionDAO {

     @Autowired
    public SeccionHibDAO(SessionFactory sessionFactory){
            setHibernateTemplate( new HibernateTemplate(sessionFactory));
    }
     
    public List<SeccionTO> listarSecciones(Integer area) {
        return getSession().createQuery(" from SeccionTO where codArea.codArea = :id ")
        .setInteger("id", area)
        .list();
    }

}
